<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			#box1
			{
				width: 200px;
				height: 200px;
				background-color: aqua !important;   //最重要,改内联样式也没用
				border: 1px solid seagreen;
				margin-top: 10px;
			}
		</style>
		<script type="text/javascript">
			window.onload=function()
			{
				var box1=document.getElementById("box1");
				var btn01=document.getElementById("btn01");
				btn01.onclick=function()
				{
					box1.style.width="300px";
					box1.style.height="300px";
					box1.style.backgroundColor="yellow";                       //需要将-去掉，将后面的字母变为大写
				}
				var btn02=document.getElementById("btn02");
				btn02.onclick=function()
				{
					alert(box1.style.width);            //只能设置和读取内联样式，无法读取样式表的样式
				}
				
				var btn03=document.getElementById("btn03");
				btn03.onclick=function()
				{
					 var flag=confirm("是否修改");
					if(flag)
					{
						var a=prompt("请输入你要修改的宽度");
						box1.style.width=a;
					}
					
					
				}
			}
		</script>
	</head>
	<body>
		<button id="btn01">点我一下</button>
		<button id="btn02">点我一下</button>
		<button id="btn03">点我一下</button>
		<div id="box1"></div>
	</body>
</html>